<style scoped>
  .content .w980{
    padding-top: 0;
  }
  .nav-path{
    position: relative;
  }
  .nav-path ol{
    width: 100%;
    height: 36px;
  }
  .nav-path button.add-hsp-btn{
    position: absolute;
    top: 0;
    right: 0;
  }
  .nav-path ol li a{
    color: #444;
  }
  .nav-path ol li:last-child{
    color: #00CB8F;
  }
  /*机构列表*/
  .list-tips{
    padding: 0;
    height: 36px;
    line-height: 36px;
    background: #F5F5F4  url(../../assets/img/list_tips.png) no-repeat 20px center;
    background-size: 4px 20px;
  }
  .list-tips span{
    float: left;
    font-size: 16px;
    height: 36px;
    line-height: 36px;
    margin-left: 36px;
    text-align: left;
  }
  .list-tips span.default-span{
    color: #6C6C6C;
    font-size: 14px;
    padding: 0 15px;
    cursor: pointer;
  }
  .list-tips span.active-span{
    color: #fff;
    background-color: #00C484;
  }
  .list-tips button.close span{
    font-size: 18px;
    margin: 2px 10px 0 0;
    text-align: left;
  }
  .org-list .list-tips button{
    float: right;
    width: 118px;
    height: 36px;
    text-align: center;
    color: #fff;
    border-radius: 16px;
    background-color: #1dc499;
    font-size: 16px;
    line-height: 36px;
    margin-right: 20px;
    /*margin-top: calc(50%-0.18rem);*/
    outline: none;
  }
  .org-list .list-opera .form-inline label{
    margin: 0 10px 0 23px;
    font-size: 12px;
    color: #666460;
    font-weight: 400;
  }
  .org-list .list-opera .form-inline button{
    width: 98px;
    height: 32px;
    display: inline-block;
    border-radius: 16px;
  }
  .list-opera{
    margin: 10px 0 20px 0;
  }
  .list-opera .form-inline .clear-research{
    margin-left: 15px;
    height: 32px;
  }
  .list-content table th {
      text-align: center;
      line-height: 36px;
      height: 36px;
      font-weight: normal;
      background-color: #F8F8F7;
  }
  .list-content table tr:nth-child(odd){
    background-color: #fff;
  }
  .list-content table tr:nth-child(even){
    background-color: #F6FBF8;
  }
  .list-content table td {
      line-height: 40px;
      text-align: center;
       color: #898989;
  }
  .list-content table tr td:nth-child(1) {
      color: #333
  }
  .list-content table tr td:nth-child(2),.list-content table tr td:nth-child(3) {
      color: #333
  }
  .list-content table tr td a.glyphicon{
    display: inline-block;
    padding: 0 0 0 20px;
    height: 16px;
    font-size: 12px;
    text-align: right;
    margin-right: 5px;
    text-decoration: none;
    color: #444;
    background-repeat: no-repeat!important;
    background-position: left center!important;
  }
  .list-content table tr td a:first-child{
    background: url(../../assets/img/edit.png);
    background-size: 14px;
  }
  .list-content table tr td .glyphicon:hover {
      color: #1dc499;
      cursor: pointer;
  }
  .list-content table tr td a:nth-child(1){
    background: url(../../assets/img/watch.png);
    background-size: 17px 12px;
  }
  .list-content table tr td a:nth-child(2){
    background: url(../../assets/img/nav.png);
    background-size: 16px;
  }
  .list-content table tr td a:nth-child(3){
    background: url(../../assets/img/account.png);
    background-size: 16px;
  }
  .list-content table tr td a:nth-child(4){
    background: url(../../assets/img/report-exp.png);
    background-size: 13px 16px;
  }
  .list-content table tr td a:nth-child(5){
    background: url(../../assets/img/QR_code.png);
    background-size: 14px;
  }
  .list-content table tr td a:nth-child(6){
    background: url(../../assets/img/dele4.png);
    background-size: 14px;
  }

  /*模态框基本设置*/
  .modal-dialog .breadcrumb{
    margin-bottom: 0;
  }
  #add-org-cover .modal-body{
    height: 500px;
    overflow: auto;
    padding: 0 15px;
  }
  /*模态框*/
  .modal-dialog{
    width: 70%;
    height: 600px;
    border-top: 0;
  }
  .modal-body .form-group{
    display: block;
    margin-bottom: 18px;
    margin-top: 18px;
  }
  .modal-body .increase-team-per select,.modal-body .increase-team-per input{
    width: 60%;
    display: inline-block;
  }
  .modal-body .form-group-foot{
    text-align: center;
  }
  .modal-body .form-group label{
    width: 27%;
    text-align: right;
  }
  .modal-body .form-inline .form-control{
    width: 48%;
    text-align: left;
    text-indent: 10px;
    margin-left: 30px;
  }
    /*hospital Map*/
  .modal-body .form-inline .list-top-title{
    vertical-align: top;
  }
  .modal-body .form-inline .hospital-map{
    width: 48%;
    height: 300px;
    overflow: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: inline-block;
    text-align: left;
    text-indent: 10px;
    margin-left: 30px;
  }
  .modal-body .form-inline .form-group .file-continer{
    height: 50px;
    background: #fff;
  }
  .modal-body .form-inline img{
    width: 80px;
    height: 80px;
    float: left;
    border: 0;
    text-indent: 0;
    border-radius: 10% 5%;
  }
  .modal-body .form-group .sim-explain-textarea{
    width: 48%;
    min-height: 122px;
    margin-left: 30px;
    overflow: auto;
    overflow-x: hidden;
    resize: none;
  }
  

  .modal-body .list-tips .team-label{
    float: left;
    height: 36px;
    line-height: 36px;
  }
  .modal-body .list-tips .new-per{
    float: right;
    height: 36px;
    line-height: 36px;
    color: #1AA9FD;
    margin-right: 46px;
    background: none;
  }
  

  /*信息填写不完整提示框*/
  .msg-without-complete .modal-dialog{
      width: 100%;
    height: 100%;
  }
  .msg-without-complete .modal-content{
    width: 50%;
    text-align: center;
    font-size: 16px;
    color: #37B06C;
    line-height: 100px;
    margin: 0 auto;
    top: 50%;
    -left: 50%;
    margin-top: -50px;
  }

  /*删除提示*/
  #delCoverTips .modal-dialog .modal-content{
    width: 90%;
    margin: 0 auto;
  }
  .del-tips{
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 20px;
  }
  .del-tips span{
    color: #f00;
    padding: 0 3px;
  }
  .modal-footer{
    text-align: center;
  }
  .modal-footer .form-group.clear-margin-bot{
    margin-bottom: 0;
  }
  .modal-footer .btn{
    outline: none;
  }
  .modal-footer .btn.btn-primary{
    background-color: #00C782;
  }
  .modal-footer .btn-opera .form-group{
    text-align: center;
  }

  /*编辑服务项目*/
  .form-group{
    display: block;
    margin-bottom: 18px;
  }
  .form-group label{
    text-align: right;
  }
  .exp-mark{
    color: red;
    height: 100%;
    line-height: 100%;
    font-size: 14px;
    margin-right: 5px;
    display: inline-block;
  }
  .form-group button{
    width: 136px;
    height: 36px;
    color: #FFF;
  }
  
  span.error{
    color: #f00;
  }
  /*查看机构*/
  .check-org .check-detail .form-group{
    display: block;
    margin-bottom: 18px;
  }
  .check-org .check-detail .form-group label{
    width: 154px;
    font-size: 12px;
    color: #6A6966;
    margin-right: 13px;
  }
  .check-org .check-detail .form-group input{
    width: 478px;
    height: 30px;
    line-height: 30px;
  }
  .check-org .check-detail .form-group textarea{
    width: 478px;
    padding: 10px;
    height: 122px;
    overflow: auto;
    resize: none;
  }
  .check-org .check-detail .form-group select{
    width: 478px;
    appearance:none;
    -moz-appearance:none;/*?Firefox?*/
    -webkit-appearance:none;/*?Safari?和?Chrome?*/
    background: url(../../assets/img/select_bg.png) no-repeat 95% center;
    background-size: 11px 6px;
  }
  .upload-img{
    width: 80px;
    height: 80px;
    border: 0;
    display: inline-block;
  }
  
  /*上传图像按钮*/
  .file-continer{
    display: inline-block;
    border: 0;
    width: 45%;
    height: 88px;
    padding: 0;
    position: relative;
    text-align: left;
    margin-left: 30px;
    background: url(../../assets/img/upload_img.png) no-repeat left center;
    background-size: 80px;
  }
  .reupload-img-btn{
    width: 100px;
    height: 30px;
    line-height: 30px;
    position: relative;
    left: 100px;
    top: 50%;
    margin-top: -15px;
    cursor: pointer;
  }
  .reupload-img-btn span,.reupload-img-btn input{
    width: 100px;
    height: 30px;
    float: left;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
  }
  .reupload-img-btn span{
    background: #00C484;
    font-size: 16px;
    line-height: 30px;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    text-align: center;
  }
  .reupload-img-btn input{
    opacity: 0;
    filter: alpha(opacity=0);
    z-index: 100;
  }

  /*信息填写不完整提示框*/
  .msg-without-complete{
    -z-index: 10200;
  }
  .msg-without-complete .modal-content{
    width: 50%;
    text-align: center;
    font-size: 16px;
    color: orangered;
    line-height: 100px;
    margin: 0 auto;
    top: 50%;
    -left: 50%;
    margin-top: -50px;
  }

  /*所在地区*/
  #area-provice,#area-city{
    width: 22%;
  }
  .area-lists{
    position: relative;
  }
  .area-lists .area-load{
    position: absolute;
      top: 30px;
      left: 30%;
      width: 45%;
      height: 300px;
      background: pink;
      overflow: auto;
      z-index: 100;
      border-radius: 10px;
  }
  .area-lists .area-load ul li{
    width: 100%;
    height: 30px;
    line-height: 30px;
    font-size: 16px;
    text-align: center;
  }
  .area-lists .area-load ul li a span{
    font-size: 16px;
  }
  #tree_3{
    width: 45%;
    left: 30%;
    height: 211px;
      overflow: auto;
  }
  .j-close-tree{
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 16px;
    display: inline-block;
    line-height: 30px;
    cursor: pointer;
    font-size: 20px;
  }

  /*模态提示*/
  #delCoverTips .modal-dialog{
    width: 48%;
    margin: 0 auto;
  }
  /*删除服务提示*/
  .del-tips{
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 20px;
  }
  .del-tips span{
    color: #f00;
    padding: 0 3px;
  }
  .start {
    font-size: 14px;
    color: red
  }
  .imgmodal{
    padding-left: 50%;
    margin-left: -200px;
    height: 250px;
    overflow: hidden;
  }
  .img-tips{
    position: absolute;
    right: 0;
    top: 20%;
    font-size: 14px;
  }
</style>

<template>
	<div class="index clearafter">
		<!-- 头部组件 -->
		<header-component></header-component>
		<div class="content cbafter">
		<!-- 侧部导航组件 -->
		 <div class="w220 fl">
            <aside-component></aside-component>
        </div>
		<!-- 右部内容区 -->
		<div class="w980 fr">
			<!-- 路径导航 -->
			<nav class="nav-path">
				<ol class="breadcrumb">
				  <li><a href="./organizationManage.html">机构管理</a></li>
				  <li>医院导航</li>
				</ol>
			</nav>
			<!-- 1-机构管理列表 -->
			<div class="org-list server-list">
				<div class="list-tips breadcrumb">
					<span>医院导航维护</span>
					<button onClick="javascript:history.back(-1);">返 回</button>
					<button @click="addOrgNavigationEvent"> + 添加导航</button>
				</div>
				<!-- 服务列表内容 -->
				<div class="list-content">
					<table class="table table-striped">
					  <table class="table table-hover">
	                        <thead>
	                            <tr>
	                                <th class="col-md-3">序 号</th>
	                                <th class="col-md-3">简 称</th>
	                                <th class="col-md-6">操 作</th>
	                            </tr>
	                        </thead>
	                        <tbody>
	                            <tr v-for="lists in serverData">
	                              <!--   <td>{{lists.id}}</td> -->
	                                <td>{{ $index +1}} </td>
	                                <td>{{lists.shortName ? lists.shortName:'未填写简称'}}</td>
	                                <td>
	                                	<a class="glyphicon" @click="watchAndEditEvent(lists)">查看</a>
	                                	<a class="glyphicon" @click="deleteOrgNavEvent(lists)">删除</a>
	                                </td>
	                            </tr>
	                            <tr class="no-data" v-if="isData">
	                            	<td colspan="3">暂无查询记录</td>
	                            </tr>
	                        </tbody>
	                    </table>
					</table>   
				</div>
				<!-- 分页 -->
				<bootpage-component v-ref:page :async="true" :lens="lenArr" :page-len="pageLen" :param="param" :headersparam="headersparam" v-if="isOpenFooterPage"></bootpage-component>
			</div>
			<!--2-添加医院导航 -->
			<div class="check-org">
				<div id="add-nav-cover" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
				  <div class="modal-dialog" role="document">
				    <div class="modal-content">
				      <div class="modal-header">
				        <div class="list-tips breadcrumb">
				      		<span class="default-span">{{navTips}}</span>
				      		<button type="button" class="close" data-dismiss="modal" aria-label="Close">
				        <span aria-hidden="true">&times;</span></button>
				      	</div>
				      </div>
				      <div class="modal-body cbafter">
				      	<!-- 添加机构表单内容 -->
			      		<form class="form-inline" id="add-hsp-org-form" action="#" enctype="multipart/form-data">
			      			<input type="hidden" name="orgId" value="{{param.orgId}}" v-model="param.orgId" id="orgId"/>
			      			<input type="hidden" name="id" value="{{addHspNav.id}}" v-model="addHspNav.id" />
			      			<!-- <input type="text" name="navigatorField" value="{{navigatorField}}"  v-if="isAddOrEdit"> -->
						  <div class="form-group">
						    <label for="exampleInputName2">导航图名称:</label>
						    <input name="shortName" type="text" class="form-control" id="shortName" placeholder="请输入导航图名称" value="{{addHspNav.shortName}}" v-model="addHspNav.shortName"  :disabled="disabledIsShow" />
						  </div>
						  <div class="form-group">
						    <label for="exampleInputName2" class="list-top-title">导航图描述:</label>
						    <textarea name="description" value="{{addHspNav.description}}" v-model="addHspNav.description" class="form-control sim-explain-textarea" placeholder="请输入导航图的相关描述等" :disabled="disabledIsShow"></textarea>
						  </div>
						  <div class="form-group">
						    <label for="exampleInputName2" class="list-top-title">上传图片:</label>
						    <div class="file-continer form-control"> 
						    	<!-- <img  class="imgpres upload-img" :src="defaultUploadImg" alt="" /> -->
						    	<!--  <img v-show="imgW" class="imgpres upload-img" :src="addHspNav.picurl" alt="" /> -->
						    	<!-- <div class="reupload-img-btn">
						    		<input type="file" id="file" name="navigatorField" class="form-control my-files" @change="imgSayPrevious($event)" :disabled="disabledIsShow" />
						    	</div> -->
						    	<imgid-btn :imgurl="imgurl"></imgid-btn>
						    	<span class="img-tips">建议图片尺寸700×700(px)</span>
						    </div>
						    
						  </div>
						</form>
				      <div class="modal-footer">
			    	    <div class="btn-opera">
			        	    <div class="form-group form-group-foot" v-show="addOperaEvent">
			        		  	<button type="button" class="btn btn-default save-btn" @click.stop.prevent="confirmAddHspEvent">保 存</button>
			        		  	<button class="btn btn-default cancel-btn" @click.stop.prevent="cancelAddHspEvent">取 消</button>
			        	    </div>
			        	    <div class="form-group form-group-foot" v-show="watchEditOpera">
			        		  	<button type="button" class="btn btn-default save-btn" v-if="nowEditShow" @click.stop.prevent="editHspMsgEvent">编 辑</button>
			        		  	<button type="button" class="btn btn-default save-btn" v-if="nowSaveShow" @click.stop.prevent="confirmSaveHspMsgEvent">保 存</button>
			        		  	<button class="btn btn-default cancel-btn" @click.stop.prevent="cancelEditHspEvent">取 消</button>
			        	    </div>
			    	    </div>
			    	</div>
				      </div>
				    </div><!-- /.modal-content -->
				  </div><!-- /.modal-dialog -->
				</div><!-- /.modal -->
			</div>
			<!-- 删除提示 -->
			<div id="delCoverTips" class="modal fade" tabindex="-1" role="dialog">
			  <div class="modal-dialog" role="document">
			    <div class="modal-content">
			      <div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			        <h4 class="modal-title">导航删除</h4>
			      </div>
			      <div class="modal-body">
			        <p class="del-tips">您确定要删除此"<span v-text="delNavName"></span>"医院导航吗？</p>
			      </div>
			      <div class="modal-footer">
			        <div class="form-group">
			        	<button type="button" class="btn btn-default save-btn" @click.stop.prevent="confirmDeleteOrg">确认</button>
			        	<button type="button" class="btn btn-default cancel-btn" data-dismiss="modal">取消</button>
			        </div>
			      </div>
			    </div><!-- /.modal-content -->
			  </div><!-- /.modal-dialog -->
			</div><!-- /.modal --> 
		</div><!-- 内容区 -->
		</div>
		
	</div>
</template>
 
<script>
	import 'assets/reset.css';
	import 'assets/lib/bootstrap-3.3.2/css/bootstrap.min.css';
    import 'assets/lib/bootstrap-3.3.2/js/bootstrap.min.js';
  
    import Header from 'components/module-head.vue';
    import Asider from 'components/menu-list.vue';
    import footerPage from 'components/BootPage.vue';
    import ImgUploadBtn from 'components/ImgUploadBtn.vue'
    import Public from 'assets/public.js'

	export default {
		data () {
			return {
				headersparam: {
		            'X-Service-Id': 'base.sysOrganizationService',
		            'X-Service-Method': 'queryOrgLayout'
		        },
		        param: {
		            nodeId: '',
		            pageNo: 1,
		            pageSize: 10
		        },

        //是否有记录
        isData: false,

        //图像预览--上传
        imgurl: '',

        //导航标题
        navTips: '',
        //picurl
        imgA: true,
        imgW: false,
        
        //是否开启分页组件
        isOpenFooterPage: false,
        //图片地址(上传预览)
        defaultUploadImg: '',
        uploadTips: '重新上传',
				serverData: {},
				//添加--机构相关信息(校验)
				addHspNav: {
					orgId: '',
					shortName: '',
					description: '',
					navigatorField: ''
				},
				//要删除的导航名称
				delNavName: '',
				delOrgId: '',
				//是否可以编辑导航
				disabledIsShow: 'disabled',
				//添加？查看？
				addOperaEvent: false,
				watchEditOpera: false,
				//编辑？保存？
				nowEditShow: true,
				nowSaveShow: false,
				//新增？保存？区分
				isAddOrEdit: false,
				navigatorField: '',

				//是否有记录
				isData: false
			}
		},
		events: {
			'data': function(datas){
				this.serverData = datas;
			},
			'serviceIconId': function(imgId){
				this.addHspNav.navigatorField = imgId;
			}
		},
		watch: {
			'serverData': 'isWatchServerData'
		},
		ready () {
			const orgIds = location.search.split('?')[1].split("=")[1];
			this.param.nodeId = orgIds;
			this.addHspNav.orgId = orgIds;
			this.isOpenFooterPage = true;
		},
		components: {
			//头部组件
			'header-component': Header,
			//侧部导航组件
			'aside-component': Asider,
			'bootpage-component': footerPage,
			'imgid-btn': ImgUploadBtn
		},
		methods: {
			//监听数据变化显示是否有记录
			isWatchServerData () {
				if(this.serverData.length == '' || this.serverData.length == null || this.serverData.length == 'undefined'){
					this.isData = true;
				}else{
					this.isData = false;
				};
			},

			//添加医院导航
			addOrgNavigationEvent () {
				this.disabledIsShow = false;
				this.navTips = '添加医院导航';
				//this.addHspNav.orgId = this.param.orgId;
				//添加？查看？
				this.addOperaEvent = true;
				this.watchEditOpera = false;
				$('#add-nav-cover').modal('show');
				this.isAddOrEdit = false;
				$('#add-hsp-org-form')[0].reset();
        let newAddData = {
          orgId: this.param.nodeId,
          shortName: '',
          description: '',
          navigatorField: ''
        };
        this.addHspNav = newAddData;
        this.imgurl = '';
        this.$broadcast('imgurl',this.imgurl);
			},
			
			//确认--添加导航
			confirmAddHspEvent () {
				var that = this;
				//校验--数据
				var flag = this.validationForm();
				//请求--判断
				if(flag == true){
					$.when(Public.commonajax('base.sysOrganizationService','saveOrgLayout','['+JSON.stringify(this.addHspNav)+']')).done(function(res){
						//res = this.isAddOrEdit ? JSON.parse(res) : res;
						if(res.code == 200){
							$('#add-nav-cover').modal('hide');
							Public.ajaxPrompt('保存成功！');
							that.$refs.page.refresh();
						}else{
							let msg = res.msg.length > 30 ? '保存失败，请联系管理员！' : res.msg;
              Public.ajaxPrompt(msg);
						}
					})
				}else{
					this.disabledIsShow = false;
					this.nowEditShow = false;
					this.nowSaveShow = true;
					setTimeout(function(){
						$('#add-nav-cover').css({'overflow-y':'scroll'});
					},1500);
					
				};	
			},

			//取消--添加导航
			cancelAddHspEvent () {
				$('#add-nav-cover').modal('hide');
			},

			//查看--编辑医院导航（医院）
			watchAndEditEvent (lists) {
				this.imgA = false;
				this.imgW = true;
				//机构标题
				this.navTips = '查看医院导航';
				//添加？查看？
				this.addOperaEvent = false;
				this.watchEditOpera = true;
				this.nowEditShow = true;
				this.nowSaveShow = false;
				$('#add-nav-cover').modal('show');
				//已有数据展示
				//this.addHspNav = lists;
				this.disabledIsShow = 'disabled';
				$('#add-nav-cover').modal('show');
				//区分-新增？编辑
				this.isAddOrEdit = true;
				this.navigatorField = lists.navigatorField;
				var that = this;
				$.when(Public.commonajax('base.sysOrganizationService','getOrgLayout','['+lists.id+']')).done(function(resss){
							that.addHspNav = resss.body;
              that.imgurl = Public.IMGVIEW_URL()+resss.body.navigatorField
				});
			},

			//查看--编辑医院导航--编辑(可编辑状态)
			editHspMsgEvent () {
				//机构标题
				this.navTips = '编辑医院导航';
				this.disabledIsShow = false;
				this.nowEditShow = false;
				this.nowSaveShow = true;
				//清空图像
				//this.defaultUploadImg = '';
			},

			//查看--编辑医院导航--保存
			confirmSaveHspMsgEvent () {
				this.defaultUploadImg = '' ? $('.my-files').val('') :$('.my-files').val();
				$('#add-nav-cover').modal('hide');
				this.disabledIsShow = 'disabled';
				this.nowEditShow = true;
				this.nowSaveShow = false;
				this.confirmAddHspEvent();
			},

			//查看--编辑医院导航--取消
			cancelEditHspEvent () {
				this.disabledIsShow = 'disabled';
				this.nowEditShow = true;
				this.nowSaveShow = false;
				$('#add-nav-cover').modal('hide');
			},

			//删除导航
			deleteOrgNavEvent (lists) {
				this.delNavName = lists.fullName?lists.fullName:lists.shortName;
				this.delOrgId = lists.id;
				$('#delCoverTips').modal('show');
			},

			//确认--删除导航
			confirmDeleteOrg () {
				var that = this;
        $('#delCoverTips').modal('hide');
				$.when(Public.commonajax('base.sysOrganizationService','deleteOrgLayout','['+this.delOrgId+']')).done(function(res){
						if(res.code == 200){
							that.$refs.page.refresh();
              Public.ajaxPrompt('删除成功！');
						}else{
							Public.ajaxPrompt('删除失败！');
						};
				});
			},

			//图像预览
			imgSayPrevious (event) {
				var that = this;
				this.uploadTips = '重新上传';
				var img = $('.imgpres');
				var ipt = $('.my-files');
				var file  = event.target.files[0];
				var reader = new FileReader();
	                reader.readAsDataURL(file);
	                reader.onload = function (event) {
	                  	that.defaultUploadImg = event.target.result;
	                };
			},

			//表单验证    
			validationForm () {
				var shortName=$("#shortName").val();
					if(shortName == ''||shortName==undefined){
						Public.ajaxPrompt('导航名称未填写！');
						return false;
					}
						return true;
			}
		}//methods
	}

</script>
